package com.carleasoft.mps.core.syslog;

import org.slf4j.Logger;
import org.springframework.stereotype.Service;

/**
 * @program: prepose-manage
 * @description: aspect日志打印service
 * @author: ztm
 * @create: 2018-10-08 10:14
 **/

@Service
public class SysLogService {

    private static final Logger log = org.slf4j.LoggerFactory.getLogger(SysLogService.class);

    public boolean save(SysLogBO sysLogBO , String around){
        // 借助log写入文件
        log.info("客户端ip："+ sysLogBO.getRemoteIp()+"，sessionID："+sysLogBO.getRequestSessionId()+"访问了接口："+sysLogBO.getUri());

        if ("LOG_BEFORRE"==around) {
            log.info("访问参数==>>" + sysLogBO.getParams());
        }
        if ("LOG_AFTER"==around) {
            log.info("返回参数<<<==" + sysLogBO.getResult());
        }

        return true;
    }
}
